dynamics_rotation Module



Contents


Interfaces

public interface rotate

  • private pure function rotate_general_1(i, j, k, Ip, Jp, Kp) result(rst)

    Constructs a rotation matrix when the orientation of the coordinate frame of interest is known relative to the parent coordinate frame.

    The matrix is of the following form.

    For orthonormal frames this is a proper rotation, so and .

    This routine does not check for orthogonallity or unit vector length; therefore, to ensure correct results it is the callers responsibility to ensure each vector is of unit length and that the unit vectors are properly orthogonal.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: i(3)

    The rotated coordinate frame x-axis unit vector.

    real(kind=real64), intent(in) :: j(3)

    The rotated coordinate frame y-axis unit vector.

    real(kind=real64), intent(in) :: k(3)

    The rotated coordinate frame z-axis unit vector.

    real(kind=real64), intent(in) :: Ip(3)

    The parent coordinate frame x-axis unit vector.

    real(kind=real64), intent(in) :: Jp(3)

    The parent coordinate frame y-axis unit vector.

    real(kind=real64), intent(in) :: Kp(3)

    The parent coordinate frame z-axis unit vector.

    Return Value real(kind=real64), (3,3)

    The resulting 3-by-3 matrix.

  • private pure function rotate_general_2(i, j, k) result(rst)

    Constructs a rotation matrix when the orientation of the coordinate frame of interest is known relative to the parent coordinate frame.

    The matrix is of the following form.

    The parent coordinate frame is assumed to be as follows.

    This routine does not check for orthogonallity or unit vector length; therefore, to ensure correct results it is the callers responsibility to ensure each vector is of unit length and that the unit vectors are properly orthogonal.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: i(3)

    The rotated coordinate frame x-axis unit vector.

    real(kind=real64), intent(in) :: j(3)

    The rotated coordinate frame y-axis unit vector.

    real(kind=real64), intent(in) :: k(3)

    The rotated coordinate frame z-axis unit vector.

    Return Value real(kind=real64), (3,3)

    The resulting 3-by-3 matrix.

public interface translate

  • private pure function translate_1(x, y, z) result(rst)

    Computes the 4-by-4 homogeneous transformation matrix describing a rigid-body translation.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: x

    The x-component of the translation.

    real(kind=real64), intent(in) :: y

    The y-component of the translation.

    real(kind=real64), intent(in) :: z

    The z-component of the translation.

    Return Value real(kind=real64), (4,4)

    The resulting 4-by-4 matrix.

  • private pure function translate_2(d) result(rst)

    Computes the 4-by-4 homogeneous transformation matrix describing a rigid-body translation.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: d(3)

    The x, y, z translation vector.

    Return Value real(kind=real64), (4,4)

    The resulting 4-by-4 matrix.


Functions

public pure function acceleration_transform(alpha, omega, a, x) result(rst)

Computes the acceleration transformation matrix relating the position of a point expressed in a rotating and translating body relative to its parent frame.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: alpha(3)

The angular acceleration vector.

real(kind=real64), intent(in) :: omega(3)

The angular velocity vector.

real(kind=real64), intent(in) :: a(3)

The translational acceleration vector describing the acceleration of the body in its parent coordinate frame.

real(kind=real64), intent(in) :: x(3)

The position vector of the body in its parent coordinate frame.

Return Value real(kind=real64), (4,4)

The 4-by-4 transformation matrix.

public pure function homogeneous_rotation_x(angle) result(rst)

Constructs the 4-by-4 homogeneous transformation matrix describing a rotation about an x-axis.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (4,4)

The resulting 4-by-4 transformation matrix.

Local Variables

public pure function homogeneous_rotation_y(angle) result(rst)

Constructs the 4-by-4 homogeneous transformation matrix describing a rotation about a y-axis.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (4,4)

The resulting 4-by-4 matrix.

public pure function homogeneous_rotation_z(angle) result(rst)

Constructs the 4-by-4 homogeneous transformation matrix describing a rotation about a y-axis.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (4,4)

The resulting 4-by-4 matrix.

public pure function rotate_x(angle) result(rst)

Constructs the rotation matrix describing a rotation about an x-axis such that .

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (3,3)

The resulting 3-by-3 matrix.

public pure function rotate_y(angle) result(rst)

Constructs the rotation matrix describing a rotation about a y-axis such that .

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (3,3)

The resulting 3-by-3 matrix.

public pure function rotate_z(angle) result(rst)

Constructs the rotation matrix describing a rotation about a y-axis such that .

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: angle

The rotation angle, in radians.

Return Value real(kind=real64), (3,3)

The resulting 3-by-3 matrix.

public pure function velocity_transform(omega, v, x) result(rst)

Computes the velocity transformation matrix relating the position of a point expressed in a rotating and translating body relative to its parent frame.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: omega(3)

The angular velocity vector.

real(kind=real64), intent(in) :: v(3)

The translation velocity vector describing the velocity of the body in its parent coordinate frame.

real(kind=real64), intent(in) :: x(3)

The position vector of the body in its parent coordinate frame.

Return Value real(kind=real64), (4,4)

The 4-by-4 transformation matrix.


Subroutines

public pure subroutine to_angle_axis(r, angle, axis)

Extracts the equivalent rotation angle and axis of rotation given a 3-by-3 rotation matrix. For a proper rotation, the angle is recovered from while the skew-symmetric part satisfies

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: r(3,3)

The 3-by-3 rotation matrix.

real(kind=real64), intent(out) :: angle

The rotation angle.

real(kind=real64), intent(out) :: axis(3)

The axis of rotation.